import { EntitySchema } from '@mikro-orm/core';

export class ImsYzdKpUsersIntegral {
  id!: number;
  userId!: number;
  origin: boolean = true;
  integral!: number;
  type!: boolean;
  note!: unknown;
  time!: string;
  uniacid!: number;
  orderId: number = 0;
}

export const ImsYzdKpUsersIntegralSchema = new EntitySchema({
  class: ImsYzdKpUsersIntegral,
  properties: {
    id: { primary: true, type: 'number' },
    userId: { type: 'number', index: 'user_id' },
    origin: { type: 'boolean', default: true },
    integral: { type: 'number' },
    type: { type: 'boolean' },
    note: { type: 'unknown', columnType: 'longtext' },
    time: { type: 'string', length: 255 },
    uniacid: { type: 'number', index: 'uniacid' },
    orderId: { type: 'number', default: 0 },
  },
});
